﻿using System.ServiceModel;
using System.ServiceModel.Activation;
using System;

namespace App_Code.Services
{
    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class WCFService
    {
        [OperationContract]
        public string SendMessageToServer(string clientMessage, bool throwError)
        {
            if (throwError)
            {
                throw new ApplicationException("Test exception");
            }
            return string.Format("The following message was received on the server: '{0}'.", clientMessage);
        }
    }
}